//
//  CPSCPlistDemoVC.m
//  CollTest
//
//  Created by codew on 11/24/21.
//

#import "CPSCPlistDemoVC.h"
#import "CPSCServiceTableViewV2Cell.h"


@interface CPSCPlistDemoVC ()<UITableViewDelegate, UITableViewDataSource>


@property (weak, nonatomic) IBOutlet UITableView *tableView;
@property (nonatomic, strong) NSMutableArray * dataArray;
@property (nonatomic, assign) NSInteger page;

@end

static NSString * CPSCServiceTableViewV2CellIdentifier = @"CPSCServiceTableViewV2Cell";

@implementation CPSCPlistDemoVC

- (void)viewDidLoad {
    [super viewDidLoad];
    // Do any additional setup after loading the view from its nib.
    
    [self setUpMainUI];
}

- (void)setUpMainUI
{
    
    self.tableView.dataSource = self;
    self.tableView.delegate = self;
    
//    WTARTWEAKSELF(weakSelf);
//    self.tableView.mj_header = [MJRefreshNormalHeader headerWithRefreshingBlock:^{
//
//        //
//        weakSelf.page = 1;
////        [weakSelf <#requestApiAuthAllDynamic#>];
//
//    }];
//    self.tableView.mj_footer = [MJRefreshBackNormalFooter footerWithRefreshingBlock:^{
//
////        [weakSelf <#requestApiAuthAllDynamic#>];
//    }];
//
//
//    [self.tableView.mj_header beginRefreshing];
}



#pragma mark - <UITableViewDelegate, UITableViewDataSource>
- (NSInteger)tableView:(UITableView *)tableView numberOfRowsInSection:(NSInteger)section
{
    return 20;//self.dataArray.count;
}

// Row display. Implementers should *always* try to reuse cells by setting each cell's reuseIdentifier and querying for available reusable cells with dequeueReusableCellWithIdentifier:
// Cell gets various attributes set automatically based on table (separators) and data source (accessory views, editing controls)

- (UITableViewCell *)tableView:(UITableView *)tableView cellForRowAtIndexPath:(NSIndexPath *)indexPath
{
    
//    <#MMAPIApiAnnouncementAuthHomeList#> *item = self.dataArray[indexPath.row];
    
    CPSCServiceTableViewV2Cell  * cell = [tableView dequeueReusableCellWithIdentifier:CPSCServiceTableViewV2CellIdentifier];
    
    if (!cell) {
        
        [tableView registerNib:[UINib nibWithNibName:CPSCServiceTableViewV2CellIdentifier bundle:nil] forCellReuseIdentifier:CPSCServiceTableViewV2CellIdentifier];
        
        cell = [tableView dequeueReusableCellWithIdentifier:CPSCServiceTableViewV2CellIdentifier];
    }
    
    cell.backgroundColor = kCPSCRandomColor;
    [cell updateCellWithItem:nil];
    
    return cell;
}


- (CGFloat)tableView:(UITableView *)tableView heightForRowAtIndexPath:(NSIndexPath *)indexPath
{
    return 190;
}
@end
